package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.system.dto.ReadRankDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.ReadRankMapper;
import com.ruoyi.system.domain.ReadRank;
import com.ruoyi.system.service.IReadRankService;

/**
 * 阅读排行Service业务层处理
 * 
 * @author saruri
 * @date 2024-09-12
 */
@Service
public class ReadRankServiceImpl implements IReadRankService
{
    @Autowired
    private ReadRankMapper readRankMapper;

    @Override
    public List<ReadRankDTO> getTopUrls(String readCategory) {
        return readRankMapper.selectTopUrls(readCategory);
    }
    /**
     * 查询阅读排行
     * 
     * @param id 阅读排行主键
     * @return 阅读排行
     */
    @Override
    public ReadRank selectReadRankById(Long id)
    {
        return readRankMapper.selectReadRankById(id);
    }

    /**
     * 查询阅读排行列表
     * 
     * @param readRank 阅读排行
     * @return 阅读排行
     */
    @Override
    public List<ReadRank> selectReadRankList(ReadRank readRank)
    {
        return readRankMapper.selectReadRankList(readRank);
    }

    /**
     * 新增阅读排行
     * 
     * @param readRank 阅读排行
     * @return 结果
     */
    @Override
    public int insertReadRank(ReadRank readRank)
    {
        readRank.setCreateTime(DateUtils.getNowDate());
        return readRankMapper.insertReadRank(readRank);
    }

    /**
     * 修改阅读排行
     * 
     * @param readRank 阅读排行
     * @return 结果
     */
    @Override
    public int updateReadRank(ReadRank readRank)
    {
        return readRankMapper.updateReadRank(readRank);
    }

    /**
     * 批量删除阅读排行
     * 
     * @param ids 需要删除的阅读排行主键
     * @return 结果
     */
    @Override
    public int deleteReadRankByIds(Long[] ids)
    {
        return readRankMapper.deleteReadRankByIds(ids);
    }

    /**
     * 删除阅读排行信息
     * 
     * @param id 阅读排行主键
     * @return 结果
     */
    @Override
    public int deleteReadRankById(Long id)
    {
        return readRankMapper.deleteReadRankById(id);
    }
//TAG_START:ReadRank_Mine_list

//ReadRank服务实现	
@Override
public List<ReadRank> selectReadRankListMine(ReadRank readRank) {
    return readRankMapper.selectReadRankListMine(readRank);
}

//TAG_END:ReadRank_Mine_list


}
